#!/bin/bash

i=0
str=""
arr=("|" "/" "-" "\\") #显示旋转效果
while [ $i -le 50 ] # i<20
do
  let index=i%4
  let count=$i*2
  printf "\e[1m[%-50s][%d%%]%c\r" "$str" "$count" "${arr[$index]}" 
  #\r光标回到开头
  sleep 0.1
  let i++
  str=#$str
done
printf "\n"
